﻿using Stateless;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Core.Workflows
{
    public enum ApprovalAction
    {
        Approve = 66,
        Reject= 67        
    }

    public enum ApprovalState
    {
        Pending = 68,
        Approved = 69,
        Rejected=70        
    }

    public class ApprovalWorkflow : StateMachine<ApprovalState, ApprovalAction>
    {
        public ApprovalWorkflow(ApprovalState state)
            : base(state)
        {
            Configure();
        }

        void Configure()
        {
            this.Configure(ApprovalState.Pending)
                .Permit(ApprovalAction.Approve, ApprovalState.Approved)
                .Permit(ApprovalAction.Reject, ApprovalState.Rejected);
        }
    }
}
